package com.servlet;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;


public class Main {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {

        Class.forName("com.mysql.cj.jdbc.Driver");

        String url ="jdbc:mysql://localhost:3306/web";

        String user ="root";
        String password ="666666";

        Connection connection=DriverManager.getConnection(url,user,password);

        String sql = "insert into t_student(stu_name,stu_gender,stu_birthday,stu_account,stu_password) values('小明','男','2000-12-13','xiaoming','123456')";
        PreparedStatement preparedStatement = connection.prepareStatement(sql);
        preparedStatement.executeUpdate();
        System.out.println(connection);

    }
}
